/**
 *  Exprezoo Records
 *  Copyright (C) 2012 Sergio De Mattia
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *  
 */
package com.sdmdev.android.exprezoorecords.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.sdmdev.android.exprezoorecords.R;
import com.sdmdev.android.exprezoorecords.json.activity.WebViewActivity;
import com.sdmdev.android.exprezoorecords.utility.ApplicationProperties;

public class AboutUsActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {
    	
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.aboutus);
        
        TextView emailTxt = (TextView) findViewById(R.id.emailTxt);        
        emailTxt.setOnClickListener(new OnClickListener() {			

			public void onClick(View v) {
		        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
		        /* Fill it with Data */
		        emailIntent.setType("plain/text");
		        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ApplicationProperties.EMAIL_RECEIVER});
		        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
		        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
		        /* Send it off to the Activity-Chooser */
		        AboutUsActivity.this.startActivity(Intent.createChooser(emailIntent, ApplicationProperties.SEND_EMAIL));
			}
		});
        
        
        Button fbBtn = (Button) findViewById(R.id.facebookBtn);        
        fbBtn.setOnClickListener(new OnClickListener() {			

			public void onClick(View v) {
			
				 Intent intentWv = new Intent(AboutUsActivity.this, WebViewActivity.class);
				 intentWv.putExtra("weblink", ApplicationProperties.FB_URL);
				 startActivity(intentWv);
			}
		});

        Button scBtn = (Button) findViewById(R.id.soundcloudBtn);        
        scBtn.setOnClickListener(new OnClickListener() {			

			public void onClick(View v) {				
				 Intent intentWv = new Intent(AboutUsActivity.this, WebViewActivity.class);
				 intentWv.putExtra("weblink", ApplicationProperties.SOUNDCLOUD_URL);
				 startActivity(intentWv);
			
			 }
		});

        Button ytBtn = (Button) findViewById(R.id.youtubeBtn);        
        ytBtn.setOnClickListener(new OnClickListener() {			
			
			public void onClick(View v) {				
				 Intent intentWv = new Intent(AboutUsActivity.this, WebViewActivity.class);
				 intentWv.putExtra("weblink", ApplicationProperties.YOUTUBE_URL);
				 startActivity(intentWv);
			}
		});
                
	}


	public void onBackPressed() {
		finish();
		startActivity(new Intent(getApplicationContext(), HomePageActivity.class));
	}       
}
